home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
mscfunct
/
key.doc
< prev
next >
Wrap
Text File
|
1987-05-06
|
877b
|
30 lines
Keyboard support functions for Microsoft C
#include <key.h>
int key_scan();
int key_shift();
o Descriptions
key_scan determines if a keystroke is waiting. If there is one, it returns
the character (in the low byte) and scan code (in the high byte). If no
keystroke is waiting, it returns a -1. This is a non-destructive read, the
character is not removed from the keyboard buffer and a subsequent call to
getch or getche will return the same character.
key_shift returns the shift key status byte as described below.
bit mask meaning
0 0x01 Right SHIFT key is depressed
1 0x02 Left SHIFT key is depressed
2 0x04 CTRL key is depressed
3 0x08 ALT key is depressed
4 0x10 SCROLL LCK active
5 0x20 NUM LCK active
6 0x40 CAPS LOCK active
7 0x80 INS active